package com.cuijq.ms.strategy.v2;

import com.cuijq.ms.strategy.v2.impl.DiscountStrategyFactory;

/**
 * @author by CuiJQ
 * @Classname OrderService
 * @Description OrderService Description
 * @Date 2021/5/28 20:58
 */
public class OrderService1 {

  public double discount(Order order) {
    double discount = 0.0;
    OrderType type = order.getType();
    if (type.equals(
        OrderType.NORMAL)) {
      // 普通订单 //...省略折扣计算算法代码
    } else if (type.equals(OrderType.GROUPON)) {
      // 团购订单 //...省略折扣计算算法代码
    } else if (type.equals(OrderType.PROMOTION)) { // 促销订单 //...省略折扣计算算法代码
    }
    return discount;
  }
}
